<template>
  <div class="rule-content">
      <!-- Lock By WP 2017-12-04 -->
      <!-- <ul class="rule-item-tab" >
        <li @click="change"  inx="0">
            <router-link :to="{ path: '/CourseRules/ScheduleTime' }" :class="{'active': index == 0}">不排课时间</router-link>
        </li>
        <li @click="change" inx="1">
            <router-link :to="{ path: '/CourseRules/EvenChurch' }" :class="{'active': index == 1}">不连堂</router-link>
        </li>
        <li @click="change" inx="2">
            <router-link :to="{ path: '/CourseRules/WorkTogether' }" :class="{'active': index == 2}">合班</router-link>
        </li>
        <li @click="change" inx="3">
            <router-link :to="{ path: '/CourseRules/BaseRule' }" :class="{'active': index == 3}">基础规则设置</router-link>
        </li>
      </ul> -->

      <!-- Created By WP 2017-12-04 -->
      <ul class="rule-item-tab" >
        <li @click="change" inx="0">
            <router-link :to="{ path: '/CourseRules/ScheduleTime' }" :class="{'active': index == 0}"><span>年级/班级不排课</span></router-link>
        </li>
        <li @click="change" inx="1">
            <router-link :to="{ path: '/CourseRules/TeacherTime' }" :class="{'active': index == 1}"><span>老师不排课</span></router-link>
        </li>
        <li @click="change" inx="2">
            <router-link :to="{ path: '/CourseRules/courseSchedule' }" :class="{'active': index == 2}"><span>课程限制</span></router-link>
        </li>
        <li @click="change" inx="3">
            <router-link :to="{ path: '/CourseRules/BaseRule' }" :class="{'active': index == 3}"><span>老师任课限制</span></router-link>
        </li>
        <li @click="change" inx="4">
            <router-link :to="{ path: '/CourseRules/WorkTogether' }" :class="{'active': index == 4}"><span>合班</span></router-link>
        </li>
      </ul>
    <router-view></router-view>
  </div>
</template>

<script>
  export default {
    data() {
      return {
          index: sessionStorage.getItem('courseInx') || 0,
      }
    },
    updated() {
       this.index = sessionStorage.getItem('courseInx') || 0;
    },
    mounted(){
    },
    methods: {
        // Unlock By WP 2017-12-04
        change(e) {
           this.index = e.currentTarget.getAttribute('inx');
           sessionStorage.setItem('courseInx', this.index );
        }
    }
  }
</script>

<style scoped>
  
</style>
